-
Notifications
You must be signed in to change notification settings - Fork 1
add next prev pagination tests #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughTests were extended to assert pagination cursor properties for product and relationship endpoints, verifying Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
tests/test_product.py (2)
223-224: Consider usingisinstance()for type checking.The assertions correctly validate the cursor structure for the first page. However, prefer
isinstance(x, str)overtype(x) is strfor idiomatic Python type checking.Apply this diff:
- assert data1["cursor"]["prev"] is None - assert type(data1["cursor"]["next"]) is str + assert data1["cursor"]["prev"] is None + assert isinstance(data1["cursor"]["next"], str)
233-234: Consider usingisinstance()for type checking.The assertions correctly validate the cursor structure for the last page. However, prefer
isinstance(x, str)overtype(x) is strfor idiomatic Python type checking.Apply this diff:
- assert data2["cursor"]["next"] is None - assert type(data2["cursor"]["prev"]) is str + assert data2["cursor"]["next"] is None + assert isinstance(data2["cursor"]["prev"], str)tests/test_relationships.py (2)
222-223: Consider usingisinstance()for type checking.The cursor assertions correctly validate pagination structure for both pages. However, prefer
isinstance(x, str)overtype(x) is strfor idiomatic Python type checking.Apply this diff:
- assert page1["cursor"]["prev"] is None - assert type(page1["cursor"]["next"]) is str + assert page1["cursor"]["prev"] is None + assert isinstance(page1["cursor"]["next"], str) next_cursor = page1["cursor"]["next"] page2 = self.client.get(f"/categories/{category['id']}/products?cursor={next_cursor}").get_json() - assert page2["cursor"]["next"] is None - assert type(page2["cursor"]["prev"]) is str + assert page2["cursor"]["next"] is None + assert isinstance(page2["cursor"]["prev"], str)Also applies to: 227-228
262-263: Consider usingisinstance()for type checking.The cursor assertions correctly validate pagination structure for both pages. However, prefer
isinstance(x, str)overtype(x) is strfor idiomatic Python type checking.Apply this diff:
- assert page1["cursor"]["prev"] is None - assert type(page1["cursor"]["next"]) is str + assert page1["cursor"]["prev"] is None + assert isinstance(page1["cursor"]["next"], str) next_cursor = page1["cursor"]["next"] page2 = self.client.get(f"/subcategories/{subcategory['id']}/products?cursor={next_cursor}").get_json() - assert page2["cursor"]["next"] is None - assert type(page2["cursor"]["prev"]) is str + assert page2["cursor"]["next"] is None + assert isinstance(page2["cursor"]["prev"], str)Also applies to: 267-268
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
tests/test_product.py(2 hunks)tests/test_relationships.py(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
tests/test_relationships.py (1)
tests/conftest.py (1)
client(26-27)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: deploy-preview
Summary by CodeRabbit
prevandnextare set correctly on first and subsequent pages.